From 0e5b0b75c591e91e5bd4af401660b5dd0bb1d020 Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Sun, 4 Sep 2016 15:28:11 +0200 Subject: [PATCH] placesview: properly recover from cancellation The current code wrongly assumes that cancellation can only happen as a result widget finalization, and consequentially does not properly recover from it. Therefore if the operation is cancelled as a result of user interaction, the entry is will stay disabled and the spinner will keep spinning. This is fixed by removal of the early bail out in case of cancellation. https://bugzilla.gnome.org/show_bug.cgi?id=764979 --- gtk/gtkplacesview.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/gtk/gtkplacesview.c b/gtk/gtkplacesview.c index 581c4ccd8e..dd2b019767 100644 --- a/gtk/gtkplacesview.c +++ b/gtk/gtkplacesview.c @@ -1173,12 +1173,9 @@ server_mount_ready_cb (GObject *source_file, emit_show_error_message (view, _("Unable to access location"), error->message); should_show = FALSE; } - else - { - /* it was cancelled, so probably it was called during finalize, bail out. */ - g_clear_error (&error); - return; - } + + /* The operation got cancelled by the user and or the error + has been handled already. */ g_clear_error (&error); } @@ -1247,13 +1244,9 @@ volume_mount_ready_cb (GObject *source_volume, emit_show_error_message (GTK_PLACES_VIEW (user_data), _("Unable to access location"), error->message); should_show = FALSE; } - else - { - /* it was cancelled, so probably it was called during finalize, bail out. */ - g_clear_error (&error); - return; - } + /* The operation got cancelled by the user and or the error + has been handled already. */ g_clear_error (&error); } -- 2.30.2